package com.automannn.cloud.practice.bootstrap;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.bootstrap.BootstrapApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * @author chenkh
 * @time 2021/10/9
 */
public class MyCloudApp {
    public static void main(String[] args) {

        SpringApplication application = new SpringApplication(MyCloudApp.class);
        ConfigurableApplicationContext applicationContext= application.run(args);

        System.out.println(applicationContext.getEnvironment().getProperty("cloudName"));
        System.out.println(applicationContext.getEnvironment().getProperty("myName"));
        System.out.println(applicationContext.getEnvironment().getProperty("bootstrapName"));
    }
}
